<template>
		<div class="padding">
 			<xm-product-edit v-if="xmProduct?.id" sub-op-type="edit" :xm-product="xmProduct"  @submit="afterEditSubmit" @fields-change="onEditFields" ref="productEdit" />
		</div>
</template>

<script> 

	import { mapState } from 'pinia'
import { useUserStore } from '@/store/modules/user'
import { useXmStore,useXmStore2 } from '@/store/modules/xm' 
	import  XmProductEdit from './XmProductEdit.vue';//修改界面

	export default {
 		computed: {
		    ...mapState(useUserStore,[
		      'userInfo','roles'
				]),
		    ...mapState(useXmStore,[
		      'xmProduct'
				]),
		},
		data() {
			return {
				 load:{ list: false, edit: false, del: false, add: false },//查询中...
				/**end 自定义属性请在上面加 请加备注**/
				editFormVisible:true,
			}
		},//end data
		methods: {
			//显示新增界面 XmProject xm_project
			afterEditSubmit(params){
				this.editFormVisible=true;
				this.$emit("submit",params);
			},
			onEditFields(res,isOk,params,row){ 
				useXmStore2().setProjectInfo(row)
				this.$emit("edit-fields",row);
			}
			/**end 自定义函数请在上面加**/
		},//end methods
		components: {
			//在下面添加其它组件
			XmProductEdit,
		},
		mounted() {
		}
	}

</script> 
